package net.homelinux.chaoswg.io.renga.core.registries;

import java.util.HashMap;
import java.util.Map;

import net.homelinux.chaoswg.io.renga.core.gui.operations.reader.Reader;

public class ReaderRegistry {
    private static Map<Class, Reader> _mapping;
    private static ReaderRegistry _this = null;
    
    private ReaderRegistry () {
        _mapping = new HashMap<Class, Reader>();
    }
    
    public static final ReaderRegistry getOperationRegistry () {
        if (_this == null) {
            _this = new ReaderRegistry ();
        }
        
        return _this;
    }
    
    public void setOperationReader (final Class clazz, final Reader or) {
        _mapping.put(clazz, or);
    }
    
    public Reader getOperationReader (final Class clazz) {
        return _mapping.get(clazz);
    }
}
